package my.study.org.springframework.context.examples.example1;

import java.util.Map;

import my.study.org.springframework.context.examples.example1.interfaces.CourseDao;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MainApplicationContext {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ApplicationContext context = new ClassPathXmlApplicationContext(
		"my/org/springframework/context/examples/example1/resources/config.xml");
		CourseDao courseDao = (CourseDao) context.getBean("courseDao");
		Map<String, String> stringMap = (Map<String, String>) context.getBean("mapOfStringString");
		pl(stringMap.put("1", "1"));
		Map<Integer, String> integerMap = (Map<Integer, String>) context.getBean("mapOfIntegerString");
		pl(integerMap.put(1,"2"));
	}
	public static void pl(Object o) {
		System.out.println(o);
	}
}
